<template>
  <div>
    <el-menu :default-active="_activeIndexInNavigationBar" @select="_handleSelect" class="el-menu" mode="horizontal"
       active-text-color="#ffd04b">
      <el-menu-item index="1"><router-link to="training" key="1">训练</router-link></el-menu-item>
      <el-menu-item index="2"><router-link to="transaction" key="2">交易</router-link></el-menu-item>
      <el-menu-item index="3"><router-link to="analysis" key="3">分析</router-link></el-menu-item>
      <el-menu-item index="4"><router-link to="model_top_concept_board_index_detail" key="4">概念板块</router-link></el-menu-item>
      <el-menu-item index="5"><router-link to="monitor_current_price" key="5">监控当前价格</router-link></el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  computed: {
    /**
     * 被选中的菜单项
     */
    _activeIndexInNavigationBar() {
      return this.$store.getters.getActiveIndexInNavigationBar;
    }
  },
  methods: {
    /**
     * 菜单项被选中
     */
    _handleSelect(key, keyPath) {
      this.$store.commit("changeActiveIndexInNavigationBar", key);
    },
  },
};
</script>

<style scoped>
.el-menu {
  width: auto;
  background-color: #545c64;
  color: "#fff";
}
</style>
